//
//  HRStore.h
//  APJ Resource
//
//  Created by Richard Zhao on 1/23/14.
//  Copyright (c) 2014 APJ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class User;
@class Staff;
@class Dept;
@class Project;

@interface HRStore : NSObject
{
    NSMutableArray *allStaffs;
    NSMutableArray *allDepts;
    NSManagedObjectContext *context;
    NSManagedObjectModel *model;
}

+ (HRStore *)sharedStore;
- (BOOL)syncTable:(NSString *)tableName withData:(NSArray *)datas byKeys:(NSArray *)keys ;

- (User *)findUserById:(NSString *)uid;
- (NSArray *)allDept;
- (NSArray *)allSkillCategory;
- (NSArray *)skillUnderCategory:(NSString *)skillCategory;
- (NSArray *)allSkillsOfStaff:(int)staffId;
- (NSArray *)educationOfStaff:(int)staffId;
- (NSArray *)workExperienceOfStaff:(int)staffId;
- (NSArray *)qualificationOfStaff:(int)staffId;
- (NSArray *)skillsOfStaff:(int)staffId;
- (NSArray *)projectAssignToStaff:(int)staffId;
- (NSArray *)projectAssignFroProject:(int)projectId;
- (NSString *)allSkillsStringOfStaff:(int)staffId;
- (NSArray *)findStaffAboutName:(NSString *)name inDept:(int)dept withSkills:(NSArray *)skills;
- (NSArray *)findProjectAboutName:(NSString *)name inDept:(int)dept;
- (Dept *)findDeptById:(int)deptId;
- (Project *)findProjectById:(int)projectId;
- (Staff *)findStaffById:(int)staffId;
- (NSArray *)reqByDept:(int)deptId inMonth:(NSTimeInterval)theMonth;
@end
